﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="Core"
                   namespace="Core.Model">
  <class name="Ferramenta" table="FERRAMENTA">
    <id name="Id" column="ID">
      <generator class="native">
        <param name="sequence">GEN_ID_FERRAMENTA</param>
      </generator>
    </id>
    <many-to-one name="EmpresaEntity" column="EMPRESA_ID" cascade="save-update" />
    <property name="Nome" column="NOME" not-null="true" />
    <property name="Descricao" column="DESCRICAO" not-null="true" />
    <property name="Ativo" column="ATIVO" not-null="true" />
    <many-to-one name="GrupoFerramentaEntity" column="GRUPO_FERRAMENTA_ID" cascade="save-update" />
    <bag name="Auditoria" inverse="true" lazy="true" cascade="delete">
      <key column="FERRAMENTA_ID" />
      <one-to-many class="Core.Model.Auditoria,Core" />
    </bag>
  </class>
</hibernate-mapping>